//
//  EXEventController.m
//  SmallEasyLife
//
//  Created by qianfeng on 15/10/26.
//  Copyright © 2015年 GXK. All rights reserved.
//

#import "EXEventController.h"
#import "Event.h"
#import "EXEventCell.h"
//体验List列表的cell点进去跳转到这里
@interface EXEventController ()

@property (weak, nonatomic) IBOutlet UIView *toolView;

@property (strong, nonatomic) EXEventCell * onlyCell;

@end

@implementation EXEventController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.view bringSubviewToFront:self.toolView];
    
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([EXEventCell class]) bundle:nil] forCellReuseIdentifier:NSStringFromClass([EXEventCell class])];
    
    self.onlyCell = [self.tableView dequeueReusableCellWithIdentifier:NSStringFromClass([EXEventCell class])];

    __weak typeof (self) ws = self;
    self.onlyCell.cellWebViewDidLoad = ^(){
//        NSLog(@"sdfdsfsdgdfsgfdgssfdgdsfgsfghf");
        [ws.tableView reloadData];
    };
    self.onlyCell.webUrlString = self.model.mobileURL;
//    self.onlyCell.cellWebViewDidLoad();
    
    UIEdgeInsets inset = self.tableView.contentInset;
    self.tableView.contentInset = UIEdgeInsetsMake(inset.top, inset.left, 44, inset.bottom);
    
    
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
//    NSLog(@"self.onlyCell.cellHeight -> %lf",self.onlyCell.cellHeight);
    return self.onlyCell.cellHeight;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
//    UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
//    view.backgroundColor = [UIColor cyanColor];
    return nil;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    
    return self.onlyCell;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
